package com.linkwechat.wecom.service.impl;

import com.linkwechat.wecom.domain.WeworkKfServicer;
import com.linkwechat.wecom.mapper.WeworkKfServicerMapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.linkwechat.wecom.service.IWeworkKfServicerService;

import java.util.List;

/**
 * 企微客服接待人员Service业务层处理
 *
 * @author ruoyi
 * @date 2022-02-18
 */
@Service
public class WeworkKfServicerServiceImpl extends ServiceImpl<WeworkKfServicerMapper, WeworkKfServicer> implements IWeworkKfServicerService {

    @Override
    public List<WeworkKfServicer> queryList(WeworkKfServicer weworkKfService) {
        LambdaQueryWrapper<WeworkKfServicer> lqw = Wrappers.lambdaQuery();
        if (weworkKfService.getId() != null){
            lqw.eq(WeworkKfServicer::getId ,weworkKfService.getId());
        }
        if (StringUtils.isNotBlank(weworkKfService.getUserid())){
            lqw.eq(WeworkKfServicer::getUserid ,weworkKfService.getUserid());
        }
        if (weworkKfService.getOpenKfid() != null){
            lqw.eq(WeworkKfServicer::getOpenKfid ,weworkKfService.getOpenKfid());
        }
        if (weworkKfService.getCreateTime() != null){
            lqw.eq(WeworkKfServicer::getCreateTime ,weworkKfService.getCreateTime());
        }
        if (weworkKfService.getStatus() != null){
            lqw.eq(WeworkKfServicer::getStatus ,weworkKfService.getStatus());
        }

        return this.list(lqw);
    }
}
